package liuch.socketdemov1;

import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * 功能描述: socket Server端<br>
 * 〈功能详细描述〉接收client过来的信息并打印到控制台
 *
 * @data 2018/8/2/002
 * @author 17101651
 */
public class SocketServerDemo {

    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(8088);

        while (true) {
            Socket socket = serverSocket.accept();
            InetAddress inetAddress = socket.getLocalAddress();
            System.out.println(inetAddress.getHostAddress());
            SocketHander socketHander = new SocketHander(socket);
            new Thread(socketHander).start();
        }
    }
}
